package pnu.ssm.chinese;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;

public class ChineseHelper {

	public static final String TAG = "ChineseHelper";

	// singleton design pattern
	private static ChineseHelper instance = new ChineseHelper();
	private ChineseHelper() {};
	public static ChineseHelper getInstance() { return instance; }


	// Local Variables
	Context context;
	public static int DEVICE_WIDTH;
	public static int DEVICE_HEIGHT;
	
	public void setContext(Context context) {
		this.context = context;
		Point size = getDeviceSize();
		DEVICE_WIDTH = size.x;
		DEVICE_HEIGHT = size.y;
	}
	
	@SuppressLint("NewApi")
	private Point getDeviceSize(){
		WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
		Display display = wm.getDefaultDisplay();
		Point size = new Point();
		display.getSize(size);  //insert value of display width, height to size var.
		return size;
	}
}
